<admintpl file="header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#')">服务策略单管理</a></li>
        <li><a href="{:U('pricing_tactics_add')}">服务策略单添加</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('Businessset/pricing_tactics_list/')}">
            <div class="controls">
                <label class="control-label">城市:</label>
                <select onchange="CityChanged();" id="city"  name="city">
                    <option value="">==请选择省==</option>
                    <volist name="province_data" id="vo">
                        <option value="{$vo.id}">{$vo.name}</option>
                    </volist>
                </select>
                <select name="city_id" id="city_id">

                </select>
                <input type="submit" class="btn btn-primary" value="搜索" />
            </div>
    </form>
    <form class="js-ajax-form" action="" method="post">

        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="15" ><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
                <th align="center">序号</th>
                <th >省</th>
                <th >市</th>
                <th >操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="datas" item="vo" key="k">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.pid}" title="ID:{$vo.pid}"></td>
                   <td align="center">{$k+1}</td>
                    <td>{$vo['province_id']|getProvinceName}</td>
                    <td>{$vo['city_id']|getCityName}</td>
                    <td>
                        <a href="{:U('Businessset/pricing_tactics_update',array('pid'=>empty($vo['pid'])?'':$vo['pid']))}">修改</a>
                        &nbsp;&nbsp;|&nbsp;&nbsp;<a href="{:U('Businessset/pricing_tactics_delete')}&pid={$vo.pid}" class="js-ajax-delete">删除</a>
                        &nbsp;&nbsp;|&nbsp;&nbsp;<a href="{:U('Businessset/pricing_tactics_see',array('pid'=>empty($vo['pid'])?'':$vo['pid']))}">查看</a>
                </tr>
            </foreach>
            </tbody>
        </table>
        <if condition="empty($datas)">
            <div style="padding: 30px;text-align: center;color: #999999">
                <i class="fa fa-database" style="font-size: 38px"></i><br />
                暂无数据
            </div>
        </if>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>
    function CityChanged(province_id){

        $.ajax({
            url:"{:U('Operation/location_api')}",
            data:"province_id="+$("#city").val(),
            dataType:"JSON",
            success:function(ret){

                cmbAddOption(ret.retValue);
            }
        });
    }

    function cmbAddOption(ret)
    {
        $("#city_id").empty();
        var opetion = '<option value="">==请选择市==</option>';
        for(var i =0; i<ret.length;i++){
            opetion+= '<option value="'+ret[i].id+'">'+ret[i].city+'</option>';
        }
        $("#city_id").append(opetion);
    }

</script>
</body>
</html